package Model;

import java.util.Date;

/**
 * 异常接收抽象类
 */
public abstract class ExceptionAbsModel {
    /**
     * @param receiveServiceName 接收方微服务名
     * @param receivePort        接收方端口号
     * @param channelName        接收队列
     * @param exceptionMqModel   接收内容
     */
    public ExceptionAbsModel(
            String receiveServiceName
            , String receivePort
            , String channelName
            , ExceptionMqModel exceptionMqModel) {
        this.setReceiveServiceName(receiveServiceName);
        this.setReceivePort(receivePort);
        this.setChannelName(channelName);
        this.setReceiveDate(new Date());
        if (exceptionMqModel != null) {
            this.setSendServiceName(exceptionMqModel.getServiceName());
            this.setSendVersion(exceptionMqModel.getVersion());
            this.setSendPort(exceptionMqModel.getPort());
            this.setExceptionName(exceptionMqModel.getExceptionName());
            this.setAuthor(exceptionMqModel.getAuthor());
            this.setSendDate(exceptionMqModel.getDate());
            this.setSendRemark(exceptionMqModel.getRemark());
            this.setSendIp(exceptionMqModel.getIp());
            this.setStackTraceElementArrays(exceptionMqModel.getStackTraceElementArrays());
        }
    }

    private String sendServiceName;
    private String sendVersion;
    private String sendPort;
    private String exceptionName;
    private String Author;
    private String sendRemark;
    private Date sendDate;
    private String sendIp;

    private String receiveServiceName;
    private String receivePort;
    private Date receiveDate;
    private String channelName;

    private ExceptionMqModel.StackTraceElementArray[] stackTraceElementArrays;

    public String getReceiveServiceName() {
        return receiveServiceName;
    }

    public void setReceiveServiceName(String receiveServiceName) {
        this.receiveServiceName = receiveServiceName;
    }

    public String getReceivePort() {
        return receivePort;
    }

    public void setReceivePort(String receivePort) {
        this.receivePort = receivePort;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getExceptionName() {
        return exceptionName;
    }

    public void setExceptionName(String exceptionName) {
        this.exceptionName = exceptionName;
    }

    public String getAuthor() {
        return Author;
    }

    public void setAuthor(String author) {
        Author = author;
    }

    public Date getSendDate() {
        return sendDate;
    }

    public void setSendDate(Date sendDate) {
        this.sendDate = sendDate;
    }

    public ExceptionMqModel.StackTraceElementArray[] getStackTraceElementArrays() {
        return stackTraceElementArrays;
    }

    public void setStackTraceElementArrays(ExceptionMqModel.StackTraceElementArray[] stackTraceElementArrays) {
        this.stackTraceElementArrays = stackTraceElementArrays;
    }

    public Date getReceiveDate() {
        return receiveDate;
    }

    public void setReceiveDate(Date receiveDate) {
        this.receiveDate = receiveDate;
    }

    public String getSendServiceName() {
        return sendServiceName;
    }

    public void setSendServiceName(String sendServiceName) {
        this.sendServiceName = sendServiceName;
    }

    public String getSendPort() {
        return sendPort;
    }

    public void setSendPort(String sendPort) {
        this.sendPort = sendPort;
    }

    public String getSendVersion() {
        return sendVersion;
    }

    public void setSendVersion(String sendVersion) {
        this.sendVersion = sendVersion;
    }

    public String getSendRemark() {
        return sendRemark;
    }

    public void setSendRemark(String sendRemark) {
        this.sendRemark = sendRemark;
    }

    public String getSendIp() {
        return sendIp;
    }

    public void setSendIp(String sendIp) {
        this.sendIp = sendIp;
    }

    class StackTraceElementArray {
        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public String getClassName() {
            return className;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public String getMethodName() {
            return methodName;
        }

        public void setMethodName(String methodName) {
            this.methodName = methodName;
        }

        public int getLineNumber() {
            return lineNumber;
        }

        public void setLineNumber(int lineNumber) {
            this.lineNumber = lineNumber;
        }

        private int index;
        private String className;
        private String fileName;
        private String methodName;
        private int lineNumber;
    }

}
